package runtimeconstant;

/**
 * @author ZhengDp
 * @Date 2023/5/12 17:31
 * @Description StringTable 垃圾回收演示
 *          // 打印字符串表的统计信息                  打印垃圾回收的详细信息
 * -Xmx10m -XX:+PrintStringTableStatistics -XX:+PrintGCDetails -verbose:gc
 */
public class StringTable_Demo3 {
    public static void main(String[] args) {
        int i =0;
        try {
            for (int i1 = 0; i1 < 10000; i1++) {
                String.valueOf(i1).intern();
                i++;
            }
        }finally {
            System.out.println(i);
        }
    }
}
